﻿package plugin.union
{
    import com.sh.game.consts.*;
    import com.sh.game.global.*;
    import plugin.union.game.*;
    import view.*;

    public class Union extends FlashUIBase
    {
        private var _ui:UnionGame;

        public function Union()
        {
            return;
        }// end function

        override protected function preLoaderInit() : void
        {
            super.preLoaderInit();
            appendLoader(Config.getUrl("assets/images/mornui/common.swf", ResourceType.NORMAL));
            appendLoader(Config.getUrl("assets/images/mornui/NewUnion.swf", ResourceType.NORMAL));
            return;
        }// end function

        override protected function initGUI() : void
        {
            this._ui = new UnionGame(this);
            mGUI = this._ui;
            return;
        }// end function

        override protected function openBefore() : void
        {
            var _loc_1:* = UserData.getUserData("unionid");
            if (_loc_1 > 0)
            {
                UnionSender._66getRedPacketInfo();
                UnionSender._4getUnionInfo(_loc_1);
                this._ui._reTime[1] = new Date().getTime();
            }
            else
            {
                UnionSender._2getUnionList();
                this._ui._reTime[0] = new Date().getTime();
            }
            return;
        }// end function

        override protected function openRefresh() : void
        {
            if (data)
            {
                this._ui.tab_title.selectedIndex = int(data);
                this._ui.showPage(int(data));
                if (int(data) == 5)
                {
                }
            }
            return;
        }// end function

    }
}
